/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ebus.ehealth.patient;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tawfeeq
 */
@Entity
@Table(name = "Patient")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Patient.findAll", query = "SELECT p FROM Patient p"),
    @NamedQuery(name = "Patient.findByPatientID", query = "SELECT p FROM Patient p WHERE p.patientID = :patientID"),
    @NamedQuery(name = "Patient.findByFirstNameE", query = "SELECT p FROM Patient p WHERE p.firstNameE = :firstNameE"),
    @NamedQuery(name = "Patient.findBySecondNameE", query = "SELECT p FROM Patient p WHERE p.secondNameE = :secondNameE"),
    @NamedQuery(name = "Patient.findByLastNameE", query = "SELECT p FROM Patient p WHERE p.lastNameE = :lastNameE"),
    @NamedQuery(name = "Patient.findByFirstNameA", query = "SELECT p FROM Patient p WHERE p.firstNameA = :firstNameA"),
    @NamedQuery(name = "Patient.findBySecondNameA", query = "SELECT p FROM Patient p WHERE p.secondNameA = :secondNameA"),
    @NamedQuery(name = "Patient.findByLastNameA", query = "SELECT p FROM Patient p WHERE p.lastNameA = :lastNameA"),
    @NamedQuery(name = "Patient.findByBirthDate", query = "SELECT p FROM Patient p WHERE p.birthDate = :birthDate"),
    @NamedQuery(name = "Patient.findByHomeTele", query = "SELECT p FROM Patient p WHERE p.homeTele = :homeTele"),
    @NamedQuery(name = "Patient.findByHomeTeleExt", query = "SELECT p FROM Patient p WHERE p.homeTeleExt = :homeTeleExt"),
    @NamedQuery(name = "Patient.findByWorkTele", query = "SELECT p FROM Patient p WHERE p.workTele = :workTele"),
    @NamedQuery(name = "Patient.findByWorkTeleExt", query = "SELECT p FROM Patient p WHERE p.workTeleExt = :workTeleExt"),
    @NamedQuery(name = "Patient.findByMobileNo", query = "SELECT p FROM Patient p WHERE p.mobileNo = :mobileNo"),
    @NamedQuery(name = "Patient.findByIndependentID", query = "SELECT p FROM Patient p WHERE p.independentID = :independentID"),
    @NamedQuery(name = "Patient.findByRelationID", query = "SELECT p FROM Patient p WHERE p.relationID = :relationID"),
    @NamedQuery(name = "Patient.findByComapny", query = "SELECT p FROM Patient p WHERE p.comapny = :comapny")})
public class Patient implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "PatientID")
    private Integer patientID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "FirstName_E")
    private String firstNameE;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "SecondName_E")
    private String secondNameE;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "LastName_E")
    private String lastNameE;
    @Size(max = 50)
    @Column(name = "FirstName_A")
    private String firstNameA;
    @Size(max = 50)
    @Column(name = "SecondName_A")
    private String secondNameA;
    @Size(max = 50)
    @Column(name = "LastName_A")
    private String lastNameA;
    @Basic(optional = false)
    @NotNull
    @Column(name = "BirthDate")
    @Temporal(TemporalType.DATE)
    private Date birthDate;
    @Size(max = 12)
    @Column(name = "HomeTele")
    private String homeTele;
    @Size(max = 7)
    @Column(name = "HomeTeleExt")
    private String homeTeleExt;
    @Size(max = 12)
    @Column(name = "WorkTele")
    private String workTele;
    @Size(max = 7)
    @Column(name = "WorkTeleExt")
    private String workTeleExt;
    @Size(max = 12)
    @Column(name = "MobileNo")
    private String mobileNo;
    @Column(name = "IndependentID")
    private Integer independentID;
    @Column(name = "relationID")
    private Integer relationID;
    @Size(max = 30)
    @Column(name = "Comapny")
    private String comapny;

    public Patient() {
    }

    public Patient(Integer patientID) {
        this.patientID = patientID;
    }

    public Patient(Integer patientID, String firstNameE, String secondNameE, String lastNameE, Date birthDate) {
        this.patientID = patientID;
        this.firstNameE = firstNameE;
        this.secondNameE = secondNameE;
        this.lastNameE = lastNameE;
        this.birthDate = birthDate;
    }

    public Integer getPatientID() {
        return patientID;
    }

    public void setPatientID(Integer patientID) {
        this.patientID = patientID;
    }

    public String getFirstNameE() {
        return firstNameE;
    }

    public void setFirstNameE(String firstNameE) {
        this.firstNameE = firstNameE;
    }

    public String getSecondNameE() {
        return secondNameE;
    }

    public void setSecondNameE(String secondNameE) {
        this.secondNameE = secondNameE;
    }

    public String getLastNameE() {
        return lastNameE;
    }

    public void setLastNameE(String lastNameE) {
        this.lastNameE = lastNameE;
    }

    public String getFirstNameA() {
        return firstNameA;
    }

    public void setFirstNameA(String firstNameA) {
        this.firstNameA = firstNameA;
    }

    public String getSecondNameA() {
        return secondNameA;
    }

    public void setSecondNameA(String secondNameA) {
        this.secondNameA = secondNameA;
    }

    public String getLastNameA() {
        return lastNameA;
    }

    public void setLastNameA(String lastNameA) {
        this.lastNameA = lastNameA;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getHomeTele() {
        return homeTele;
    }

    public void setHomeTele(String homeTele) {
        this.homeTele = homeTele;
    }

    public String getHomeTeleExt() {
        return homeTeleExt;
    }

    public void setHomeTeleExt(String homeTeleExt) {
        this.homeTeleExt = homeTeleExt;
    }

    public String getWorkTele() {
        return workTele;
    }

    public void setWorkTele(String workTele) {
        this.workTele = workTele;
    }

    public String getWorkTeleExt() {
        return workTeleExt;
    }

    public void setWorkTeleExt(String workTeleExt) {
        this.workTeleExt = workTeleExt;
    }

    public String getMobileNo() {
        return mobileNo;
    }

    public void setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
    }

    public Integer getIndependentID() {
        return independentID;
    }

    public void setIndependentID(Integer independentID) {
        this.independentID = independentID;
    }

    public Integer getRelationID() {
        return relationID;
    }

    public void setRelationID(Integer relationID) {
        this.relationID = relationID;
    }

    public String getComapny() {
        return comapny;
    }

    public void setComapny(String comapny) {
        this.comapny = comapny;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (patientID != null ? patientID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Patient)) {
            return false;
        }
        Patient other = (Patient) object;
        if ((this.patientID == null && other.patientID != null) || (this.patientID != null && !this.patientID.equals(other.patientID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ebus.ehealth.patient.Patient[ patientID=" + patientID + " ]";
    }
    
}
